package com.faw.fengyue.rfid.utils.sdkinit;

import android.app.Application;

import com.faw.fengyue.rfid.MyApp;
import com.faw.fengyue.rfid.constants.HttpConstants;
import com.xuexiang.xhttp2.XHttpSDK;

/**
 * 版本更新 初始化
 *
 * @author wdc
 * @since 2024-04-3 15:51
 */
public final class XHttp2Init {

    private XHttp2Init() {
        throw new UnsupportedOperationException("u can't instantiate me...");
    }

    public static void init(Application application) {
        //初始化网络请求框架，必须首先执行
        XHttpSDK.init(application);
        //需要调试的时候执行
        if (MyApp.isDebug()) {
            XHttpSDK.debug();
        }
//        XHttpSDK.debug(new CustomLoggingInterceptor()); //设置自定义的日志打印拦截器
        //设置网络请求的全局基础地址
        XHttpSDK.setBaseUrl(HttpConstants.getInstance().getBaseHttpUrl());
//        XHttpSDK.setBaseUrl("http://192.168.1.113:9527");
//        XHttpSDK.setBaseUrl("https://gitee.com/");
//        //设置动态参数添加拦截器
//        XHttpSDK.addInterceptor(new CustomDynamicInterceptor());
//        //请求失效校验拦截器
//        XHttpSDK.addInterceptor(new CustomExpiredInterceptor());
    }
}
